using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.TeamFoundation.WorkItemTracking.Client;

namespace TXLooker.WorkItemExtention.WIQL
{
    public class WorkItemSortField
    {
        public WorkItemFieldDefinition WIFieldDef
        {
            get { return this.m_fieldDef; }
        }
        private readonly WorkItemFieldDefinition m_fieldDef = new WorkItemFieldDefinition();

        public SortType SortType
        {
            get { return this.m_sort;  }
            set { this.m_sort = value; }
        }
        private SortType m_sort = SortType.Descending;

        public WorkItemSortField()
        { }
        public WorkItemSortField( FieldDefinition field, SortType stype ) : this()
        {
            this.WIFieldDef.Init( field );
            this.SortType = stype;
        }
        public WorkItemSortField( WorkItemFieldDefinition field, SortType stype ) : this()
        {
            this.WIFieldDef.Init( field );
            this.SortType = stype;
        }
        public WorkItemSortField( SortField field ) : this( field.FieldDefinition, field.SortType )
        { }
    }
}
